<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        {
            var age = 100;

            var obj = {
                age: 20,
                say: function () {
                    alert(this.age)
                }
            }

            obj.say()
        }


        // ----------------------------

        {

            var age = 100;

            var obj = {
                age: 20,
                say: () => {
                    alert(this.age)
                }
            }

            obj.say()
        }




            let a = 'zs';

            let aa = setTimeout(function () {
                console.log(this)

                console.log(this.a)
            }, 1000);





        

        // {
        //     let a = 'zs';

        //     let aa = setTimeout(() => {
        //         console.log(this)
        //         console.log(this.a)
        //     }, 1000)
        // }

    </script>
</body>

</html>